Optimal. Leaf size=31 \[ \frac{\sin \left (a+\frac{b}{x}\right ) \cos \left (a+\frac{b}{x}\right )}{2 b}-\frac{1}{2 x} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0268488, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {3379, 2635, 8} \[ \frac{\sin \left (a+\frac{b}{x}\right ) \cos \left (a+\frac{b}{x}\right )}{2 b}-\frac{1}{2 x} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3379
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \frac{\sin ^2\left (a+\frac{b}{x}\right )}{x^2} \, dx &=-\operatorname{Subst}\left (\int \sin ^2(a+b x) \, dx,x,\frac{1}{x}\right )\\ &=\frac{\cos \left (a+\frac{b}{x}\right ) \sin \left (a+\frac{b}{x}\right )}{2 b}-\frac{1}{2} \operatorname{Subst}\left (\int 1 \, dx,x,\frac{1}{x}\right )\\ &=-\frac{1}{2 x}+\frac{\cos \left (a+\frac{b}{x}\right ) \sin \left (a+\frac{b}{x}\right )}{2 b}\\ \end{align*}
Mathematica [A] time = 0.0555031, size = 32, normalized size = 1.03 \[ \frac{\sin \left (2 \left (a+\frac{b}{x}\right )\right )}{4 b}-\frac{a+\frac{b}{x}}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.007, size = 34, normalized size = 1.1 \begin{align*} -{\frac{1}{b} \left ( -{\frac{1}{2}\cos \left ( a+{\frac{b}{x}} \right ) \sin \left ( a+{\frac{b}{x}} \right ) }+{\frac{a}{2}}+{\frac{b}{2\,x}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.962725, size = 34, normalized size = 1.1 \begin{align*} \frac{x \sin \left (\frac{2 \,{\left (a x + b\right )}}{x}\right ) - 2 \, b}{4 \, b x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.21303, size = 72, normalized size = 2.32 \begin{align*} \frac{x \cos \left (\frac{a x + b}{x}\right ) \sin \left (\frac{a x + b}{x}\right ) - b}{2 \, b x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.39074, size = 262, normalized size = 8.45 \begin{align*} \begin{cases} - \frac{b \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{2 b x \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b x \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 2 b x} - \frac{2 b \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{2 b x \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b x \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 2 b x} - \frac{b}{2 b x \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b x \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 2 b x} - \frac{2 x \tan ^{3}{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{2 b x \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b x \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 2 b x} + \frac{2 x \tan{\left (\frac{a}{2} + \frac{b}{2 x} \right )}}{2 b x \tan ^{4}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 4 b x \tan ^{2}{\left (\frac{a}{2} + \frac{b}{2 x} \right )} + 2 b x} & \text{for}\: b \neq 0 \\- \frac{\sin ^{2}{\left (a \right )}}{x} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.09892, size = 30, normalized size = 0.97 \begin{align*} \frac{\sin \left (2 \, a + \frac{2 \, b}{x}\right )}{4 \, b} - \frac{1}{2 \, x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]